            <script type="text/javascript">
                if($('#is_edit').val()=='1'){
                    $(".select-pro2item").show();
                    $('.is_public').prop('checked',true)
                }else{
                    $(".select-pro2item").hide();
                }
                $(".is_public").click(function(){
                    $(".is_public").prop('checked',$(this).prop('checked'))
                    $(".select-pro2item").toggle();
                })
                
            </script>
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="ntModalLabel" type="{$request}">{$title}</h4>
            </div>
            <div class="modal-body">
                <input type="hidden" id="ispublic" value="{if isset($item)}{$item.is_public}{/if}">
                <input type="hidden" id="id" value="{if isset($id)}{$id}{/if}">
                <div class="row clearfix">
                    <div class="col-md-12 column">
                        <div class="alert alert-dismissable alert-info">
                            <button type="button" class="close">×</button>
                             <p></p>
                        </div>
                    </div>
                </div>

               <div class="row clearfix" style="padding-top:12px">
                    <div class="col-md-12 column">
                        <ul class="nav nav-tabs">
                            <li class="active" lang="zh">
                                <a href="#zh" data-toggle="tab">{:lang('Chinese')}</a>
                            </li>
                            <li lang="en">
                                <a href="#en" data-toggle="tab">{:lang('English')}</a>
                            </li>
                            <li lang="pt">
                                <a href="#pt" data-toggle="tab">{:lang('Portuguese')}</a>
                            </li>
                        </ul>
                    </div>
                </div>
                <div class="tab-content">
                    <div id="zh" class="tab-pane active">
                            <table class="table table-hover ntTable">
                                <colgroup>
                                    <col width="20%">
                                    <col width="80%">
                                </colgroup>
                                <tbody>
                                       <tr>
                                        <td >{:lang('name')}<span class="required"></span></td>
                                        <td>
                                            <input type="text" class="form-control itemcat_name" placeholder="产品配件类型名称" value="{if isset($item)}{$item.name_zh}{/if}">
                                        </td>
                                    </tr>
                                    <!-- <tr>
                                        <td>{:lang("quantity")}<span class="required"></span></td>
                                        <td>
                                            <input type="number" class="form-control text-right itemcat_qty" placeholder="{:lang("quantity_of_accessories_per_product")}" value="1">
                                        </td>
                                    </tr> -->
                                       <tr>
                                        <td>{:lang('universal')}</td>
                                        <td>
                                            <label class="checkbox-inline">
                                                <input type="checkbox" name="optionsCheckboxsinline" class="is_public" value="1"> {:lang("whether_to_designate_a_general_product_as_na_accessory")}
                                            </label>
                                        </td>
                                    </tr>
                                    
                                    <tr class="select-pro2item">
                                        <td>产品分类<span class="required"></span></td>
                                        <td>
                                            <div class="input-group" style="width:100%">
                                                <div class="input-group">
                                                    <select  class="form-control procat procat_zh" name=""  style="width: 150px;">
                                                        <option value="0">{:lang("please_select_a_product_category")}</option>
                                                        {if isset($procat)}
                                                        {volist name='procat' id='vo'}
                                                        <option value="{$vo.id}">{$vo.level|default=0|str_repeat='&emsp;',###*2}{$vo.name_zh}</option>
                                                        {/volist}
                                                        {/if}
                                                    </select>
                                                    
                                                </div>
                                                
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="select-pro2item">
                                        <td>{:lang("product_accessory_name")}<span class="required"></span></td>
                                        <td>
                                            <div class="input-group" style="width:100%">
                                                <div class="input-group">
                                                        <div class="input-group-btn">
                                                        <select  class="form-control prolist prolist_zh" name="" id="" style="width: 150px;">
                                                                {if isset($itempro)}
                                                                    <option value="{$itempro.id}">{$itempro.content}</option>
                                                                {/if}
                                                            </select>
                                                        </div>
                                                        <input type="text" class="form-control searchText" id="" placeholder="{:lang("enter_product_name_/_number")}">
                                                        <div class="input-group-btn">
                                                            <button type="button" class="btn btn-primary search">
                                                                <span class="glyphicon glyphicon-search" > </span> {:lang('search')}
                                                            </button>
                                                        </div>
                                                    
                                                </div>
                                                
                                            </div>
                                        </td>
                                    </tr>
                                    <tr class="select-pro2item">
                                        <td>{:lang("the_role_of_accessory")}<span class="required"></span></td>
                                        <td>
                                            <select class="form-control itemchar itemchar_zh" id=''>
                                                {if isset($itemprochar)}
                                                    <option value="{$itemprochar.id}">{$itemprochar.content}</option>
                                                {/if}
                                            </select>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                    </div>

                    <div id="en" class="tab-pane">
                            <table class="table table-hover ntTable">
                                    <colgroup>
                                        <col width="20%">
                                        <col width="80%">
                                    </colgroup>
                                    <tbody>
                                           <tr>
                                            <td >{:lang('name')}<span class="required"></span></td>
                                            <td>
                                                <input type="text" class="form-control itemcat_name" placeholder="产品配件类型名称" value="{if isset($item)}{$item.name_en}{/if}">
                                            </td>
                                        </tr>
                                        <!-- <tr>
                                            <td>{:lang("quantity")}<span class="required"></span></td>
                                            <td>
                                                <input type="number" class="form-control text-right itemcat_qty" placeholder="{:lang("quantity_of_accessories_per_product")}" value="1">
                                            </td>
                                        </tr> -->
                                           <tr>
                                            <td>{:lang('universal')}</td>
                                            <td>
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="optionsCheckboxsinline" class="is_public" value="1"> {:lang("whether_to_designate_a_general_product_as_na_accessory")}
                                                </label>
                                            </td>
                                        </tr>
                                        
                                        <tr class="select-pro2item">
                                            <td>产品分类<span class="required"></span></td>
                                            <td>
                                                <div class="input-group" style="width:100%">
                                                    <div class="input-group">
                                                        <select  class="form-control procat procat_en" name="" id="" style="width: 150px;">
                                                            <option value="0">{:lang("please_select_a_product_category")}</option>
                                                            {if isset($procat)}
                                                            {volist name='procat' id='vo'}
                                                            <option value="{$vo.id}">{$vo.level|default=0|str_repeat='&emsp;',###*2}{$vo.name_en}</option>
                                                            {/volist}
                                                            {/if}
                                                        </select>
                                                        
                                                    </div>
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="select-pro2item">
                                            <td>{:lang("product_accessory_name")}<span class="required"></span></td>
                                            <td>
                                                <div class="input-group" style="width:100%">
                                                    <div class="input-group">
                                                            <div class="input-group-btn">
                                                            <select  class="form-control prolist prolist_en" name="" id="" style="width: 150px;">
                                                                    {if isset($itempro)}
                                                                        <option value="{$itempro.id}">{$itempro.content}</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                            <input type="text" class="form-control searchText" id="" placeholder="{:lang("enter_product_name_/_number")}">
                                                            <div class="input-group-btn">
                                                                <button type="button" class="btn btn-primary search">
                                                                    <span class="glyphicon glyphicon-search" > </span> {:lang('search')}
                                                                </button>
                                                            </div>
                                                        
                                                    </div>
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="select-pro2item">
                                            <td>{:lang("the_role_of_accessory")}<span class="required"></span></td>
                                            <td>
                                                <select class="form-control itemchar itemchar_en" id=''>
                                                    {if isset($itemprochar)}
                                                        <option value="{$itemprochar.id}">{$itemprochar.content}</option>
                                                    {/if}
                                                </select>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                    </div>

                    <div id="pt" class="tab-pane">
                            <table class="table table-hover ntTable">
                                    <colgroup>
                                        <col width="20%">
                                        <col width="80%">
                                    </colgroup>
                                    <tbody>
                                           <tr>
                                            <td >{:lang('name')}<span class="required"></span></td>
                                            <td>
                                                <input type="text" class="form-control itemcat_name" placeholder="产品配件类型名称" value="{if isset($item)}{$item.name_pt}{/if}">
                                            </td>
                                        </tr>
                                        <!-- <tr>
                                            <td>{:lang("quantity")}<span class="required"></span></td>
                                            <td>
                                                <input type="number" class="form-control text-right itemcat_qty" placeholder="{:lang("quantity_of_accessories_per_product")}" value="1">
                                            </td>
                                        </tr> -->
                                           <tr>
                                            <td>{:lang('universal')}</td>
                                            <td>
                                                <label class="checkbox-inline">
                                                    <input type="checkbox" name="optionsCheckboxsinline" class="is_public" value="1"> {:lang("whether_to_designate_a_general_product_as_na_accessory")}
                                                </label>
                                            </td>
                                        </tr>
                                        
                                        <tr class="select-pro2item">
                                            <td>产品分类<span class="required"></span></td>
                                            <td>
                                                <div class="input-group" style="width:100%">
                                                    <div class="input-group">
                                                        <select  class="form-control procat procat_pt" name="" id="" style="width: 150px;">
                                                            <option value="0">{:lang("please_select_a_product_category")}</option>
                                                            {if isset($procat)}
                                                            {volist name='procat' id='vo'}
                                                            <option value="{$vo.id}">{$vo.level|default=0|str_repeat='&emsp;',###*2}{$vo.name_pt}</option>
                                                            {/volist}
                                                            {/if}
                                                        </select>
                                                        
                                                    </div>
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="select-pro2item">
                                            <td>{:lang("product_accessory_name")}<span class="required"></span></td>
                                            <td>
                                                <div class="input-group" style="width:100%">
                                                    <div class="input-group">
                                                            <div class="input-group-btn">
                                                            <select  class="form-control prolist prolist_pt" name="" id="" style="width: 150px;">
                                                                    {if isset($itempro)}
                                                                        <option value="{$itempro.id}">{$itempro.content}</option>
                                                                    {/if}
                                                                </select>
                                                            </div>
                                                            <input type="text" class="form-control searchText" id="" placeholder="{:lang("enter_product_name_/_number")}">
                                                            <div class="input-group-btn">
                                                                <button type="button" class="btn btn-primary search">
                                                                    <span class="glyphicon glyphicon-search" > </span> {:lang('search')}
                                                                </button>
                                                            </div>
                                                        
                                                    </div>
                                                    
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="select-pro2item">
                                            <td>{:lang("the_role_of_accessory")}<span class="required"></span></td>
                                            <td>
                                                <select class="form-control itemchar itemchar_pt" id=''>
                                                    {if isset($itemprochar)}
                                                        <option value="{$itemprochar.id}">{$itemprochar.content}</option>
                                                    {/if}
                                                </select>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                    </div>
                </div>
                
            </div>
            <input type="hidden" id="request" value="{$request}">
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span>{:lang('cancel')}</button>
                <button type="button" class="btn btn-primary save" style="padding-left:24px;padding-right:24px"><span class="glyphicon glyphicon-floppy-disk"></span>{:lang('save')}</button>
            </div>
    <script type="text/javascript">

        $('.procat').change(function(){

            if($('#ntModalLabel').attr('type') == 'add'){
                var url ='/admin/proitem/addopen';
            }else{
                var url ='/admin/proitem/editopen';
            }
            // alert($('#procat option:selected').val())
            $('.procat').val($(this).val())
            $.ajax({
                // url: '/admin/proitem/proAddNewJump_itemAjax?request=pro',
                url:url,
                type: 'post',
                data: {cat_id:$('.procat option:selected').val(),pro_id:$('#pro_id').val(),lang:'zh',request:'pro'},
                dataType: 'json',
                success: function (res) {
                    res = JSON.parse(res)
                    if(res.status == 1){
                        $('.prolist_zh').empty();
                        $('.prolist_en').empty();
                        $('.prolist_pt').empty();
                        var prozh_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        var proen_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        var propt_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        for (var i = 0;i < res.data.length; i++) {
                            prozh_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_zh+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            proen_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_en+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            propt_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_pt+"</option>";
                        }
                        $('.prolist_zh').append(prozh_html);
                        $('.prolist_en').append(proen_html);
                        $('.prolist_pt').append(propt_html);
                    }else{
                        alert(res.msg);
                    }
                }
            })
        });

        $('.prolist').change(function(){

            if($('#ntModalLabel').attr('type') == 'add'){
                var url ='/admin/proitem/addopen';
            }else{
                var url ='/admin/proitem/editopen';
            }
            // alert($('#procat option:selected').val())
            $('.prolist').val($(this).val())
            $.ajax({
                // url: '/admin/proitem/proAddNewJump_itemAjax?request=prochar',
                url:url,
                type: 'post',
                data: {id:$('.prolist option:selected').val(),lang:'zh',request:'prochar'},
                dataType: 'json',
                success: function (res) {
                    res = JSON.parse(res)
                    if(res.status == 1){
                        $('.itemchar_zh').empty();
                        $('.itemchar_en').empty();
                        $('.itemchar_pt').empty();
                        var procharzh_html = "<option value='0'>"+langcon.please_select+"产品角色</option>";
                        var procharen_html = "<option value='0'>"+langcon.please_select+"产品角色</option>";
                        var procharpt_html = "<option value='0'>"+langcon.please_select+"产品角色</option>";
                        for (var i = 0;i < res.data.length; i++) {
                            procharzh_html += "<option value='"+res.data[i].id+"'>"+res.data[i].content_zh+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            procharen_html += "<option value='"+res.data[i].id+"'>"+res.data[i].content_en+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            procharpt_html += "<option value='"+res.data[i].id+"'>"+res.data[i].content_pt+"</option>";
                        }
                        $('.itemchar_zh').append(procharzh_html);
                        $('.itemchar_en').append(procharen_html);
                        $('.itemchar_pt').append(procharpt_html);
                    }else{
                        alert(res.msg);
                    }
                }
            })
        });

        $('.itemchar').change(function(){
            $('.itemchar').val($(this).val())
        })

        $('.search').click(function(){

            if($('#ntModalLabel').attr('type') == 'add'){
                var url ='/admin/proitem/addopen';
            }else{
                var url ='/admin/proitem/editopen';
            }
            $.ajax({
                // url: '/admin/proitem/proAddNewJump_itemAjax?request=search',
                url:url,
                type: 'post',
                data: {searchText:$('.searchText').val(),pro_id:$('#pro_id').val(),lang:'zh',request:'searchText'},
                dataType: 'json',
                success: function (res) {
                    res = JSON.parse(res)
                    console.log(res)
                    if(res.code == 2000){
                        $('.prolist_zh').empty();
                        $('.prolist_en').empty();
                        $('.prolist_pt').empty();
                        var prozh_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        var proen_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        var propt_html = "<option value='0'>"+langcon.please_select+"产品</option>";
                        for (var i = 0;i < res.data.length; i++) {
                            prozh_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_zh+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            proen_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_en+"</option>";
                        }
                        for (var i = 0;i < res.data.length; i++) {
                            propt_html += "<option value='"+res.data[i].id+"'>"+res.data[i].name_pt+"</option>";
                        }
                        $('.prolist_zh').append(prozh_html);
                        $('.prolist_en').append(proen_html);
                        $('.prolist_pt').append(propt_html);
                    }else{
                        alert(res.msg);
                    } 
                }
            })
        });

        $('.itemcat_qty').change(function(){
            $('.itemcat_qty').val($(this).val())
        })

        $('.save').click(function(){
            // console.log(lang);
            if($('#ntModalLabel').attr('type') == 'add'){
                var url ='/admin/proitem/addopen?request=insert';
            }else{
                var url ='/admin/proitem/editopen?request=update';
            }
            console.log($('.is_public').eq(0).prop('checked'))
            var data={
                        qty:$('.itemcat_qty').eq(0).val(),
                        pro_id:$('.prolist').eq(0).val(),
                        prochar_id:$('.itemchar').eq(0).val(),
                        is_public:$('.is_public').prop('checked'),
                        itemcat_name:{
                            zh:$('.itemcat_name').eq(0).val(),
                            en:$('.itemcat_name').eq(1).val(),
                            pt:$('.itemcat_name').eq(2).val()
                        },
                        id:$('#id').val()
                    }
                    console.log(data)
            $.ajax({
                url: url,
                type: 'post',
                data,
                success: function (data) {
                    data = JSON.parse(data)
                    if(data.status==1){
                        change_mes_type('.alert',data.status)
                        //toastr.info(data.msg)
                        $('.alert').show()
                        $('.alert p').html('*'+data.msg+'<br>')
                        $('#itemtype_editModal').modal('hide')
                    }else{
                        change_mes_type('.modal-body .alert',data.status)
                        $('.modal-body .alert').show()
                        $('.modal-body .alert p').html('*'+data.msg+'<br>')
                        //toastr.warning(data.msg);
                        state=true
                    }
                }
            })
        });
    </script>